package org.oss.client;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.UnsupportedEncodingException;
import java.util.Scanner;

public class LogReader {

	public static void main(String[] args) throws IOException {
		File file=new File("E:/工作/项目/云存储OSS/test/20160121/1");
		String[] names = {"un","system","endpoint","用于唯一标示该请求的UUID","是否开启了访问日志功能","请求者的阿里云ID",
				"请求的功能","bucket","key",""};
		//key 大小 处理时间 错误码 请求长度 bucket的userid bucket变化量
		//public%2F20160121%2F" 49 1 "-" 289 "1501753186949068" - "-
        InputStreamReader read = new InputStreamReader(new FileInputStream(file),"utf-8");//考虑到编码格式
        
        BufferedReader bufferedReader = new BufferedReader(read);
        String a ="";
        int i =0;
		while((a = bufferedReader.readLine()) != null){
			Scanner sc = new Scanner(System.in);
			System.out.println("第"+(++i)+"行");

			String name = sc.nextLine();
			String[] s=a.split("\" \"");
			System.out.println(s[0].split(" ")[1]);
			System.out.println(s[0].split(" ")[9]);
			System.out.println(s[0].split(" ")[10]);
			System.out.println(s[0].split(" ")[11]);
			for(String str:s){
				System.out.println(str);
			}
			
		}
		
	}
	
	
	
}
